package com.songlanyun.modules.shop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.songlanyun.common.utils.PageUtils;
import com.songlanyun.modules.shop.entity.ShopUserRoleConfigEntity;
import com.songlanyun.modules.shop.model.dto.ShopUserRoleConfigDTO;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 商家的会员等配置，（本系统，不提供商家创建自己的等级，只能系统自动给商家初始化）
 *
 * @author Mark
 * @email sunlightcs@gmail.com
 * @date 2020-11-05 18:07:51
 */
public interface ShopUserRoleConfigService extends IService<ShopUserRoleConfigEntity> {

    PageUtils queryPage(Map<String, Object> params);

    List<ShopUserRoleConfigEntity> select(Long shopId);

    void saveShopConfig(Long shopId, boolean isJmShop);

    ShopUserRoleConfigEntity getByShopIdAndId(Long shopId, Integer id);

    ShopUserRoleConfigEntity getByShopIdAndRoleCode(Long shopId, String roleCode);

    ShopUserRoleConfigEntity getByShopIdAndLevel(Long shopId, Integer level);

    ShopUserRoleConfigEntity update(Long shopId, ShopUserRoleConfigDTO dto);

    List<ShopUserRoleConfigEntity> getByShopId(Long shopId);

    ShopUserRoleConfigEntity getByThresholdCompare(Long shopId, BigDecimal totalConsumption);

    ShopUserRoleConfigEntity getByNumCompare(Long shopId, Long num);

    /**
     * 最低等级
     *
     * @param id
     * @return
     */
    ShopUserRoleConfigEntity getLowestLevel(Long id);

    /**
     * 获取商家输出等级名称
     * @param roleCode
     * @return
     */
    String getRoleNameByRoleCode(Long shopId,String roleCode);
}

